package com.xiangxiao.rpan.storage.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/11/16 20:36
 */
@Getter
public enum FilterConfigHiddenModeEnum {
  /**
   * 仅隐藏
   */
  HIDDEN("hidden"),

  /**
   * 隐藏并不可访问 (针对目录)
   */
  INACCESSIBLE("inaccessible"),

  /**
   * 隐藏并不可访问 (针对文件)
   */
  DISABLE_DOWNLOAD("disable_download");

  private String value;

  @JsonValue
  public String getFilterConfigHiddenModeEnum() {
    return this.value.toUpperCase();
  }

  @JsonCreator
  public static FilterConfigHiddenModeEnum fromString(String type) {
    return type == null
        ? null
        : FilterConfigHiddenModeEnum.valueOf(type.toUpperCase());
  }

  FilterConfigHiddenModeEnum(String val) {
    this.value = val.toUpperCase();
  }
}
